]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Use a PopupMenuManager for the message tray context menu
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 19 Apr 2013 15:46:06 +0000 (11:46 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 13 Aug 2013 15:24:19 +0000 (11:24 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=699272

js/ui/messageTray.js

index 534bfd80523724d271202b9a801076e44ebcb46e..ab1fa64ac0b77e23dab082f205e68aa4f0a7062c 100644 (file)
@@ -1766,6 +1766,8 @@ const MessageTray = new Lang.Class({
         this._updateNoMessagesLabel();
 
         this._contextMenu = new MessageTrayContextMenu(this);
+        this._contextMenuManager = new PopupMenu.PopupMenuManager({ actor: this.actor });
+        this._contextMenuManager.addMenu(this._contextMenu);
 
         let clickAction = new Clutter.ClickAction();
         this.actor.add_action(clickAction);
@@ -1774,8 +1776,6 @@ const MessageTray = new Lang.Class({
             let button = action.get_button();
             if (button == 3)
                 this._openContextMenu();
-            if (button == 1 && this._contextMenu.isOpen)
-                this._grabHelper.ungrab({ actor: this._contextMenu.actor });
         }));
 
         clickAction.connect('long-press', Lang.bind(this, function(action, actor, state) {
@@ -1792,11 +1792,6 @@ const MessageTray = new Lang.Class({
     _openContextMenu: function () {
         let [x, y, mask] = global.get_pointer();
         this._contextMenu.setPosition(Math.round(x), Math.round(y));
-        this._grabHelper.grab({ actor: this._contextMenu.actor,
-                                onUngrab: Lang.bind(this, function () {
-                                    this._contextMenu.close(BoxPointer.PopupAnimation.FULL);
-                                })
-        });
         this._contextMenu.open(BoxPointer.PopupAnimation.FULL);
     },